package StudyCode.summary.myfile;

import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CreatingFilesDirectories {
	public static void main(String[] args) {
		try {
			Files.createDirectory(Paths.get("E:\\Copy"));
			System.out.println("E:\\Copy 目录创建成功。");
			Path newFilePath = FileSystems.getDefault().getPath("E:\\Copy\\newFile.txt");
			Path testFile = Files.createFile(newFilePath);
			System.out.println(testFile + " 文件创建成功!");
		} catch (IOException ex) {
			ex.printStackTrace();
		}
	}
}
